# encoding: utf-8
"""
!/usr/bin/python3
@Author: Gao Shuo
@Time: 2018/9/12 17:08 
@ReadMe:
    Input: 标注灰度图片路径（可以逗号分割多个目录），原始图片路径（可以逗号分割多个目录）, 输出文件名
    Output:
    生成train.txt
    只用label path里面的图片
"""
import os
import sys
if __name__ == "__main__":
    labelPath = sys.argv[1]
    originPath = sys.argv[2]
    dest = sys.argv[3]
    # 文件夹
    output = open(dest, 'w')
    li_path = labelPath.split(',')
    li_ori_path = originPath.split(',')
    for i in range(len(li_path)):
        li = os.listdir(li_path[i])
        for filepath in li:
            file_label =  os.path.join(li_path[i], filepath)
            file_origin =  os.path.join(li_ori_path[i], filepath)
            text = file_origin +" "+ file_label
            output.write(text+'\n')
    output.close()



